home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-01 | 3.6 KB | 80 lines | [TEXT/MMCC] |
- typedef Handle NntpStreamHandle;
- typedef OSErr (*NntpChunkFunction) (Ptr t, long tLen, Boolean *abort);
-
- typedef enum NntpErr {
- nntpNoErr, /* no error */
- nntpNoSuchGroupErr, /* no such group or group access restriction */
- nntpNoSuchArticleErr, /* no such article */
- nntpServerErr, /* server error */
- nntpOSErr /* OS error */
- } NntpErr;
-
- typedef struct NntpStreamOptions {
- short idleTime; /* stream is automatically closed if idle for this
- many minutes, or 0 to disable */
- Boolean useXPAT; /* true to use XPAT command for searches */
- Boolean sendModeReader; /* true to send MODE READER command after connect */
- Boolean batchedCmds; /* true to use batched GROUP commands */
- Boolean newConnection; /* true to establish new connection before getting
- group info */
- Boolean authOnConnect; /* true to authorize on each new connection */
- char username[32]; /* authorization username */
- char password[32]; /* authorization password */
- } NntpStreamOptions;
-
- typedef struct NntpGroupInfo {
- long offset; /* offset into strings of group name */
- long first; /* first article number in group */
- long last; /* last article number in group */
- long count; /* estimate of number of articles in group */
- char status; /* group status, lower case */
- Boolean ok; /* true if no error when getting group info */
- } NntpGroupInfo, *NntpGroupInfoPtr, **NntpGroupInfoHandle;
-
- typedef struct NntpHeaderInfo {
- long number; /* article number */
- long offset; /* offset into strings of header contents */
- } NntpHeaderInfo, *NntpHeaderInfoPtr, **NntpHeaderInfoHandle;
-
- Boolean IsLegalBinHexLine (unsigned char *p, long len);
- Boolean IsLegalUULine (unsigned char *p, long len);
-
- NntpErr NntpOpen (char *host, NntpStreamOptions *options, NntpStreamHandle *stream);
- NntpErr NntpClose (NntpStreamHandle stream);
- NntpErr NntpAbort (NntpStreamHandle stream);
-
- NntpErr NntpIdle (void);
-
- NntpErr NntpSetStreamOptions (NntpStreamHandle stream, NntpStreamOptions *options);
-
- NntpErr NntpGetGroupList (NntpStreamHandle stream, unsigned long time,
- Boolean needNumbers, NntpGroupInfoHandle *info, Handle *strings, long *numGroups);
- NntpErr NntpGetGroupNames (NntpStreamHandle stream, unsigned long time,
- char *statusFilter, Handle *strings, long *numGroups);
- NntpErr NntpGetGroupInfo (NntpStreamHandle stream, char *group,
- long *first, long *last, long *count);
- NntpErr NntpGetMultipleGroupInfo (NntpStreamHandle stream, NntpGroupInfoHandle info,
- long numGroups, Handle strings);
-
- NntpErr NntpGetHeaders (NntpStreamHandle stream, char *group, long first, long last,
- char *header, char *pattern,
- void (*buildXPAT)(char *pattern, char *regExp, short regExpLen),
- Boolean (*matchPattern)(char *pattern, char *string),
- NntpHeaderInfoHandle *info, Handle *strings, long *numHeaders);
-
- NntpErr NntpGetArticle (NntpStreamHandle stream, char *group, long number,
- char *id, char *part, Boolean truncateIfAttachedFile,
- Boolean requireEncodedTextBeginLine, Handle *text,
- Boolean *attachedFile);
- NntpErr NntpGetChunkyArticle (NntpStreamHandle stream, char *group, long number,
- char *id, char *part, NntpChunkFunction chunkFunction, Boolean *aborted);
- NntpErr NntpPostArticle (NntpStreamHandle stream, Handle text, Boolean *postIndeterminate);
- NntpErr NntpAuthorize (NntpStreamHandle stream, char *username, char *password);
-
- NntpErr NntpGetHello (NntpStreamHandle stream, CStr255 msg);
- NntpErr NntpGetHelp (NntpStreamHandle stream, Handle *text);
- NntpErr NntpGetIPAddr (NntpStreamHandle stream, unsigned long *ipAddr);
-
- void NntpGetServerErrInfo (CStr255 cmd, long *num, CStr255 msg);
- OSErr NntpGetOSErr (void);
-